const path = require('path'); // 根路径
const resolve = (dir) => path.join(__dirname, dir); // 拼接路径

module.exports = {
    transpileDependencies: ['uview-ui'],
    productionSourceMap: false,
    chainWebpack: (config) => {
        config.resolve.alias // 添加别名
            .set('@', resolve('src'))
            .set('@pages', resolve('src/pages'))
            .set('@static', resolve('src/static'))
            .set('@images', resolve('src/static/images'));
    },
    devServer: {
        proxy: {
            '/api': {
                // target: 'http://47.107.35.108:14000',
                target: 'https://swap.yunlegeyou.cn/api',
                changeOrigin: true,
                pathRewrite: {
                    '^/api': ''
                }
            }
        }
    }
}
